﻿using System;
using RaytracerLib.MathLib;

namespace RaytracerLib.Layers
{
    public class MulOperationLayer : BinaryLayer
    {
        public MulOperationLayer(Layer a_child_layer_1, Layer a_child_layer_2)
            : base(a_child_layer_1, a_child_layer_2)
        {
        }

        public override ColorFloat GetColor(Vector2 a_uv, Intersection a_intersection)
        {
            return ChildLayer1.GetColor(a_uv, a_intersection) *
                ChildLayer2.GetColor(a_uv, a_intersection);
        }

        public override double GetValue(Vector2 a_uv, Intersection a_intersection)
        {
            return ChildLayer1.GetValue(a_uv, a_intersection) *
                ChildLayer2.GetValue(a_uv, a_intersection);
        }

        public override Tangents GetTangents(Vector2 a_uv, Vector2 a_tx, Vector2 a_ty,
            Intersection a_intersection)
        {
            throw new InvalidOperationException();
        }
    }
}